It has often been said that DOS no longer has a place in modern programming, and I see from a friends PC that for some obscure reason, Windows 2000 does not appear to have any access to DOS. But as someone a little too 'old in the tooth' to learn all the complexities of understanding API calls fully, I find it amazing how much trouble some of us go to find the API call to perform a task where the DOs command is still available with Windows 95/98 Mil. and XP etc. For example the Format.com, Diskcopy.com, Tree.com, Attrib.exe etc are still to be found with my Windows XP. The inbuilt PATH command can be very useful for finding where to place or find a program that will be automatically be activated from any Directory. However I understand it is possible many other future versions of Windows may no longer be able to access any DOS calls whatsoever. That is progress ?
For those like me who still wish to use DOS occasionally, it would be nice to be able to test a DOS or Windows based program using DOS, or activate an inbuilt DOS command using LB. You can of course activate a .BAT program containing the command, or use the %1 etc similar to the LB CommandLine$, but this is rather a crude method. Some time ago I created a simple DOSHELL.EXE program using QuickBasic, which the following makes use.
You will see the following, used in conjunction with the DOSSHEL.EXE can also be used to divert to a temporary DOS shell similar to the MSDOS Command Prompt supplied by Windows 95/98 and XP. Finally I might add there are occasions when Windows refuses to allow you to say delete a file for some obscure reason, and you may find it can be done with DOS if safe to do so. Also when I first used Windows 95 I was unaware of the dangers of how easy it was to move or delete files using My Computer etc. As a result Windows soon failed to start up complaining two files were missing. I eventually solved the problem by booting up in DOS, and using the command DIR /s filename which finds any file or files using * etc. To check the whole drive make sure you are in the root directory if necessary by first entering the command CD \
Gordon Sweet
' SIMPLE DOS SHELL NEEDS DOSHELL.EXE by GS
nomainwin
open "DOS SHELL" for text_nsb as #dos
#dos "!trapclose [quit]"
#dos "!font arial 13 bold"
#dos " Enter program, or DOS command"
#dos " Enter D to acitivate DOS shell"
[start]
prompt "Enter DOS command, Program or D for DOS"; dos$
if dos$ = "" then [quit]
dos$ = upper$(dos$)
if dos$ = "D" then dos$ = ""
run$ = "doshell.exe "+dos$
run run$
confirm "Another Y/N?"; more$
if more$ = "yes" then [start]
[quit]
close #dos
end